package com.mymoney.utils;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class MimeTypeUtils {
	private static final Map<String, String> extensionMap =
			Collections.unmodifiableMap(new HashMap<String, String>() {
				private static final long serialVersionUID = 1L;
				{
					put("3g2", "video/3gpp2");
					put("3gp", "video/3gpp");
					put("aac", "audio/x-aac");
					put("abs", "audio/x-mpeg");
					put("adp", "audio/adpcm");
					put("aif", "audio/x-aiff");
					put("aifc", "audio/x-aiff");
					put("aiff", "audio/x-aiff");
					put("art", "image/x-jg");
					put("asf", "video/x-ms-asf");
					put("asx", "video/x-ms-asf");
					put("au", "audio/basic");
					put("avi", "video/x-msvideo");
					put("avx", "video/x-rad-screenplay");
					put("axa", "audio/annodex");
					put("axv", "video/annodex");
					put("bmp", "image/bmp");
					put("btif", "image/prs.btif");
					put("cgm", "image/cgm");
					put("cmx", "image/x-cmx");
					put("dib", "image/bmp");
					put("djv", "image/vnd.djvu");
					put("djvu", "image/vnd.djvu");
					put("dra", "audio/vnd.dra");
					put("dts", "audio/vnd.dts");
					put("dtshd", "audio/vnd.dts.hd");
					put("dv", "video/x-dv");
					put("dvb", "video/vnd.dvb.file");
					put("dwg", "image/vnd.dwg");
					put("dxf", "image/vnd.dxf");
					put("ecelp4800", "audio/vnd.nuera.ecelp4800");
					put("ecelp7470", "audio/vnd.nuera.ecelp7470");
					put("ecelp9600", "audio/vnd.nuera.ecelp9600");
					put("eol", "audio/vnd.digital-winds");
					put("f4v", "video/x-f4v");
					put("fbs", "image/vnd.fastbidsheet");
					put("fh", "image/x-freehand");
					put("fh4", "image/x-freehand");
					put("fh5", "image/x-freehand");
					put("fh7", "image/x-freehand");
					put("fhc", "image/x-freehand");
					put("flac", "audio/flac");
					put("fli", "video/x-fli");
					put("flv", "video/x-flv");
					put("fpx", "image/vnd.fpx");
					put("fst", "image/vnd.fst");
					put("fvt", "video/vnd.fvt");
					put("g3", "image/g3fax");
					put("gif", "image/gif");
					put("h261", "video/h261");
					put("h263", "video/h263");
					put("h264", "video/h264");
					put("ico", "image/x-icon");
					put("ief", "image/ief");
					put("jpe", "image/jpeg");
					put("jpeg", "image/jpeg");
					put("jpg", "image/jpeg");
					put("jpgm", "video/jpm");
					put("jpgv", "video/jpeg");
					put("jpm", "video/jpm");
					put("kar", "audio/midi");
					put("ktx", "image/ktx");
					put("lvp", "audio/vnd.lucent.voice");
					put("m1v", "video/mpeg");
					put("m2a", "audio/mpeg");
					put("m2v", "video/mpeg");
					put("m3a", "audio/mpeg");
					put("m3u", "audio/x-mpegurl");
					put("m4a", "audio/mp4");
					put("m4b", "audio/mp4");
					put("m4r", "audio/mp4");
					put("m4u", "video/vnd.mpegurl");
					put("m4v", "video/mp4");
					put("mac", "image/x-macpaint");
					put("mdi", "image/vnd.ms-modi");
					put("mid", "audio/midi");
					put("midi", "audio/midi");
					put("mj2", "video/mj2");
					put("mjp2", "video/mj2");
					put("mmr", "image/vnd.fujixerox.edmics-mmr");
					put("mov", "video/quicktime");
					put("movie", "video/x-sgi-movie");
					put("mp1", "audio/mpeg");
					put("mp2", "audio/mpeg");
					put("mp2a", "audio/mpeg");
					put("mp3", "audio/mpeg");
					put("mp4", "video/mp4");
					put("mp4a", "audio/mp4");
					put("mp4v", "video/mp4");
					put("mpa", "audio/mpeg");
					put("mpe", "video/mpeg");
					put("mpeg", "video/mpeg");
					put("mpega", "audio/x-mpeg");
					put("mpg", "video/mpeg");
					put("mpg4", "video/mp4");
					put("mpga", "audio/mpeg");
					put("mpv2", "video/mpeg2");
					put("mxu", "video/vnd.mpegurl");
					put("npx", "image/vnd.net-fpx");
					put("oga", "audio/ogg");
					put("ogg", "audio/ogg");
					put("ogv", "video/ogg");
					put("pbm", "image/x-portable-bitmap");
					put("pct", "image/pict");
					put("pcx", "image/x-pcx");
					put("pgm", "image/x-portable-graymap");
					put("pic", "image/pict");
					put("pict", "image/pict");
					put("pls", "audio/x-scpls");
					put("png", "image/png");
					put("pnm", "image/x-portable-anymap");
					put("pnt", "image/x-macpaint");
					put("ppm", "image/x-portable-pixmap");
					put("psd", "image/vnd.adobe.photoshop");
					put("pya", "audio/vnd.ms-playready.media.pya");
					put("pyv", "video/vnd.ms-playready.media.pyv");
					put("qt", "video/quicktime");
					put("qti", "image/x-quicktime");
					put("qtif", "image/x-quicktime");
					put("ra", "audio/x-pn-realaudio");
					put("ram", "audio/x-pn-realaudio");
					put("ras", "image/x-cmu-raster");
					put("rgb", "image/x-rgb");
					put("rip", "audio/vnd.rip");
					put("rlc", "image/vnd.fujixerox.edmics-rlc");
					put("rmi", "audio/midi");
					put("rmp", "audio/x-pn-realaudio-plugin");
					put("snd", "audio/basic");
					put("spx", "audio/ogg");
					put("svg", "image/svg+xml");
					put("svgz", "image/svg+xml");
					put("tif", "image/tiff");
					put("tiff", "image/tiff");
					put("ulw", "audio/basic");
					put("uva", "audio/vnd.dece.audio");
					put("uvg", "image/vnd.dece.graphic");
					put("uvh", "video/vnd.dece.hd");
					put("uvi", "image/vnd.dece.graphic");
					put("uvm", "video/vnd.dece.mobile");
					put("uvp", "video/vnd.dece.pd");
					put("uvs", "video/vnd.dece.sd");
					put("uvu", "video/vnd.uvvu.mp4");
					put("uvv", "video/vnd.dece.video");
					put("uvva", "audio/vnd.dece.audio");
					put("uvvg", "image/vnd.dece.graphic");
					put("uvvh", "video/vnd.dece.hd");
					put("uvvi", "image/vnd.dece.graphic");
					put("uvvm", "video/vnd.dece.mobile");
					put("uvvp", "video/vnd.dece.pd");
					put("uvvs", "video/vnd.dece.sd");
					put("uvvu", "video/vnd.uvvu.mp4");
					put("uvvv", "video/vnd.dece.video");
					put("viv", "video/vnd.vivo");
					put("wav", "audio/x-wav");
					put("wax", "audio/x-ms-wax");
					put("wbmp", "image/vnd.wap.wbmp");
					put("weba", "audio/webm");
					put("webm", "video/webm");
					put("webp", "image/webp");
					put("wm", "video/x-ms-wm");
					put("wma", "audio/x-ms-wma");
					put("wmv", "video/x-ms-wmv");
					put("wmx", "video/x-ms-wmx");
					put("wvx", "video/x-ms-wvx");
					put("xbm", "image/x-xbitmap");
					put("xif", "image/vnd.xiff");
					put("xpm", "image/x-xpixmap");
					put("xwd", "image/x-xwindowdump");
				}});


	public static String getMimeType(String extension) {

		return extensionMap.get(extension);
	}

}
